package com.study.data.utils;

/**
 * @program: java-study-of-learner
 * @description: 排序工具类
 * @author: future
 * @create: 2020-11-21 17:19
 **/
public class SortUtils {
    /**
     * 创建随机数组
     */
    public static int[] createArr(int index) {
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            double num = Math.round(Math.random() * 100);
            int n = new Double(num).intValue();
            arr[i] = n;
        }
        return arr;
    }

    /**
     * 打印随机数组
     */
    public static void printArr(int[] arr) {
        for (int i = 0; i <arr.length ; i++) {
            System.out.print( arr[i]+" ");
        }
        System.out.println();
    }
}
